package com.hjy.hjyojbackendjudgeservice.controller.inner;

import com.hjy.hjyojbackendjudgeservice.judge.JudgeService;
import com.hjy.hjyojbackendjudgeservice.model.entity.QuestionSubmit;
import com.hjy.hjyojbackendserviceclient.service.JudgeServiceClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @version 1.0
 * @Author HJY_Maker
 * @Date 2024/7/5 星期五 13:54
 */
@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeServiceClient {
    @Resource
    private JudgeService judgeService;
    /**
     * 判题服务
     * 传入题目id，获取题目信息
     *
     * @param questionSubmitId
     * @return
     */
    @Override
    @PostMapping("/do")
    public QuestionSubmit dojudge(@RequestParam("questionSubmitId") Long questionSubmitId) {
        return judgeService.dojudge(questionSubmitId);
    }
}
